package de.idgard.android.addon.ui.services;

import org.apache.http.cookie.Cookie;

import android.net.http.SslCertificate.DName;
import android.webkit.WebView;
import de.idgard.android.addon.ui.services.dto.FieldDTO;
import de.idgard.android.addon.ui.services.dto.IDGardCookieDTO;

/**
 * 
 * @author ckaratza
 * 
 */

public interface BrowserUtilityService {

	String getUserAgentStringOfCurrentView();

	boolean checkIfOpenLoginPageWithWebApp();

	String updateWebViewUserAgentStringWithProfileInfo(
			final String profileToken, FieldDTO... miscFields);

	boolean removeProfileInfoFromWebViewUserAgentString();

	boolean checkIfCertificateIssuerIsUniscon(DName dname);

	String provisionUserAgentString(final WebView wview);

	IDGardCookieDTO extractIDGardCookieData(final String url);

	IDGardCookieDTO getIDGardData();

	void setIDGardData(IDGardCookieDTO dto);

	boolean isCookieValid(final String cookie);

	String getIDGardServerUrl();

	boolean checkIfIDGardLoginUrl(final String url);

	boolean checkIfIDGardDomainOrigination(final String url);

	boolean checkIfIDStartPage(final String url);

	void invalidateIDGardONModeCookies();

	Cookie[] getIdgardCookies();
}
